#ifndef __AUDIOCOMMAND_INCLUDED
#define __AUDIOCOMMAND_INCLUDED


namespace Audio
{
	class AudioCommand
	{
	public:
		AudioCommand(AudioVoice* voice) : sender(voice) {}
		virtual void Do(IAudioDevice* device) = 0;
		virtual ~AudioCommand(){}
	protected:
		AudioVoice*  sender;
	};

	class PlayingVoiceCommand : public AudioCommand
	{
	public:
		PlayingVoiceCommand(AudioPlayingVoice* p);
		

	protected:
		AudioPlayingVoice* playingVoice;
	};


	class CreateVoiceCommand : public AudioCommand
	{
	public:	
		CreateVoiceCommand(AudioVoice* voice) : AudioCommand(voice){}
		virtual void Do(IAudioDevice* device);			
	
	}; 

	class DestroyVoiceCommand : public AudioCommand
	{
	public:
		DestroyVoiceCommand(AudioVoice* voice) : AudioCommand(voice){}
		virtual void Do(IAudioDevice* device);
	};

	class PlayCommand : public PlayingVoiceCommand
	{
	public:
		PlayCommand(AudioPlayingVoice* voice) : PlayingVoiceCommand(voice){}
		virtual void Do(IAudioDevice* device);
	};

	class StopCommand : public PlayingVoiceCommand
	{
	public:
		StopCommand(AudioPlayingVoice* voice) : PlayingVoiceCommand(voice) {}
		virtual void Do(IAudioDevice* device);
	};
	class VolumeCommand : public PlayingVoiceCommand
	{
	public:
		VolumeCommand(AudioPlayingVoice* voice) : PlayingVoiceCommand(voice){}
		virtual void Do(IAudioDevice* device);
	};

	class LoadDataCommand : public PlayingVoiceCommand
	{
	public:
		LoadDataCommand(AudioPlayingVoice* voice) : PlayingVoiceCommand(voice){}
		virtual void Do(IAudioDevice* device);
	};

	class InitDeviceCommand : public AudioCommand
	{
	public:
		InitDeviceCommand() : AudioCommand(NULL){}
		virtual void Do(IAudioDevice* device);
	};

	class DestroyDeviceCommand : public AudioCommand
	{
	public:
		DestroyDeviceCommand() : AudioCommand(NULL){}
		virtual void Do(IAudioDevice* device);
	};

	class EndAudioThreadCommand : public AudioCommand
	{
	public:
		EndAudioThreadCommand() : AudioCommand(NULL){}
		virtual void Do(IAudioDevice* device);
	};

	class SetVolumeCommand : public PlayingVoiceCommand
	{
	public:
		SetVolumeCommand(AudioPlayingVoice* voice, float v) : PlayingVoiceCommand(voice), volume(v){}
		virtual void Do(IAudioDevice* device);
	private:
		float volume;
	};

	class ResumeCommand : public PlayingVoiceCommand
	{
	public:
		ResumeCommand(AudioPlayingVoice* voice) : PlayingVoiceCommand(voice){}
		virtual void Do(IAudioDevice* device);
	};
}

#endif